package com.astudio.lhasa.model;

import android.os.Parcel;
import android.os.Parcelable;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Created by nanaifeng on 2018/11/18.
 */
@Entity
public class TourSpot implements Parcelable{
    @Id(autoincrement = true)
    private Long id;

    private String name;
    private String nameEn;
    private String summary;
    private String contact;

    private String ticketInfo;
    private double locationLat;
    private double locationLon;

    private long city;

    @Generated(hash = 1172437937)
    public TourSpot(Long id, String name, String nameEn, String summary,
            String contact, String ticketInfo, double locationLat,
            double locationLon, long city) {
        this.id = id;
        this.name = name;
        this.nameEn = nameEn;
        this.summary = summary;
        this.contact = contact;
        this.ticketInfo = ticketInfo;
        this.locationLat = locationLat;
        this.locationLon = locationLon;
        this.city = city;
    }

    @Generated(hash = 1586166945)
    public TourSpot() {
    }

    protected TourSpot(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readLong();
        }
        name = in.readString();
        nameEn = in.readString();
        summary = in.readString();
        contact = in.readString();
        ticketInfo = in.readString();
        locationLat = in.readDouble();
        locationLon = in.readDouble();
        city = in.readLong();
    }

    public static final Creator<TourSpot> CREATOR = new Creator<TourSpot>() {
        @Override
        public TourSpot createFromParcel(Parcel in) {
            return new TourSpot(in);
        }

        @Override
        public TourSpot[] newArray(int size) {
            return new TourSpot[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(id);
        }
        dest.writeString(name);
        dest.writeString(nameEn);
        dest.writeString(summary);
        dest.writeString(contact);
        dest.writeString(ticketInfo);
        dest.writeDouble(locationLat);
        dest.writeDouble(locationLon);
        dest.writeLong(city);
    }


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getTicketInfo() {
        return ticketInfo;
    }

    public void setTicketInfo(String ticketInfo) {
        this.ticketInfo = ticketInfo;
    }

    public double getLocationLat() {
        return locationLat;
    }

    public void setLocationLat(double locationLat) {
        this.locationLat = locationLat;
    }

    public double getLocationLon() {
        return locationLon;
    }

    public void setLocationLon(double locationLon) {
        this.locationLon = locationLon;
    }

    public String getNameEn() {
        return nameEn;
    }

    public void setNameEn(String nameEn) {
        this.nameEn = nameEn;
    }

    public long getCity() {
        return city;
    }

    public void setCity(long city) {
        this.city = city;
    }

    @Override
    public String toString() {
        return "TourSpot{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", nameEn='" + nameEn + '\'' +
                ", summary='" + summary + '\'' +
                ", contact='" + contact + '\'' +
                ", ticketInfo='" + ticketInfo + '\'' +
                ", locationLat=" + locationLat +
                ", locationLon=" + locationLon +
                ", city=" + city +
                '}';
    }
}
